import {ElMessageBox} from "element-plus";

export function messageBox(title: string, success?: Function,cancel?: Function,hint = "提示",confirmText = '确定',cancelText="取消") {
    ElMessageBox.confirm(
        title,
        hint,
        {
            confirmButtonText: confirmText,
            cancelButtonText: cancelText,
            type: 'warning',
        }
    )
        .then(() => {
            if(success){
                success.call(null)
            }

        })
        .catch(() => {
            if(cancel){
                cancel.call(null)
            }


        })
}